package io.renren.modules.app.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.app.service.AppPayService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Program: renren-fast
 * @Package: io.renren.modules.mynj.controller
 * @ClassName: AppPayController
 * @Description: app支付控制类
 * @Author: ShenPengPeng
 * @CreateDate: 2018-11-07 09:16
 * @Version: 1.0
 */
@RestController
@RequestMapping("/app/apppay")
public class AppPayController {
    @Autowired
    private AppPayService appPayService;
    /**
     * 所有app支付列表
     */
    @PostMapping("/list")
    @RequiresPermissions("app:pay:list")
    public R list(@RequestParam Map<String, Object> params){
        System.out.println(params);
        PageUtils page = appPayService.queryPage(params);
        return R.ok().put("page", page);
    }
    //删除
    @PostMapping("/delete")
    @RequiresPermissions("app:pay:delete")
    public R delete(@RequestBody String[] ids){
        appPayService.deleteBatch(ids);
        return R.ok();
    }
}
